{% extends 'index.html' %}

{% block title %}
FuSite-工具-年度事件表
{% endblock %}

{% block head %}
{% endblock %}

{% block content %}

<div class="box box mt-6 ml-6 mr-6">
    <div class="table-container">
        <table class="table is-hoverable is-fullwidth is-bordered">
            <thead>
                <tr>
                    <th title="事件名">事件名</th>
                    <th title="公历日期">公历日期</th>
                    <th title="农历日期">农历日期</th>
                    <th title="距今天数">距今天数</th>
                    <th title="星期几">星期几</th>
                    <th title="操作">操作</th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <th title="事件名">事件名</th>
                    <th title="公历日期">公历日期</th>
                    <th title="农历日期">农历日期</th>
                    <th title="距今天数">距今天数</th>
                    <th title="星期几">星期几</th>
                    <th title="操作">操作</th>
                </tr>
            </tfoot>
            <tbody>
            {% for i in date %}
                <tr>
                    <td>{{ i["name"] }}</td>
                    <td>{{ i["gong"] }}</td>
                    <td>{{ i["nong"] }}</td>
                    <td>{{ i["distance"] }}</td>
                    <td>{{ i["week"] }}</td>
                    {% if i["delete"] %}
                    <td>
                        <form action="/tools/date_delete" method="post">
                            <input type="hidden" name="delete" value="{{ i['name'] }}">
                            <input type="submit" class="button is-danger" value="删除">
                        </form>
                    </td>
                    {% else %}
                    <td></td>
                    {% endif %}
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <form action="/tools/date_update" method="post">
        <div class="grid">
            <input type="text" class="input is-fullwidth is-primary cell" placeholder="请输入事件名称" required name="name">
            <div class="select is-fullwidth is-primary">
                <select required name="c">
                    <option>公历</option>
                    <option>农历</option>
                </select>
            </div>
            <input type="datetime" class="input is-primary is-fullwidth" placeholder="请输入月" required name="month">
            <input type="datetime" class="input is-primary is-fullwidth" placeholder="请输入日" required name="day">
        </div>
        <input type="submit" class="button is-fullwidth mt-3 is-primary" value="提交">
    </form>
</div>

{% endblock %}
